<div class="page-bar">
    <ul class="page-breadcrumb">
        <li>
            <a href="#">Company Facility</a>
            <i class="fa fa-circle"></i>
        </li>
        <li>
            <a href="#">Facility Management</a>
        </li>
    </ul>
</div>
<div class="container-fluid" style="margin:15px">
    <div class="row">
        <div class="portlet light bordered">
            <div class="portlet-title">
                <div class="caption">
                    <span class="caption-subject bold">Facility</span>
                </div>
            </div>
            <div class="portlet-body form form-horizontal">
                <form>
                    <div class="row form-group">
                        <div class="col-md-4">
                            <label>Name</label>
                            <input type="text" ng-model="searchInfo.nameRegex" class="form-control" placeholder="Name"/>
                        </div>
                    </div>
                    <div class="row form-actions right">
                        <waitting-btn type="submit" btn-class="btn blue" ng-click="search()"
                                      value="'Search'" is-loading="loading"></waitting-btn>
                    </div>
                </form>
            </div>
            <!-- TABLE -->
            <div class="row">
                <div class="portlet light box-shadow-none">
                    <div class="portlet-title">
                        <div class="caption">
                            <span class="caption-subject bold"> Search Results</span>
                        </div>
                    </div>
                    <div class="portlet-body">
                        <div ng-show="!loading" class="dataTables_wrapper no-footer">
                            <div class="table-scrollable">
                                <table class="table table-striped table-bordered table-hover table-checkable order-column dataTable no-footer"
                                       id="sample_1" role="grid" aria-describedby="sample_1_info">
                                    <thead>
                                    <tr role="row">
                                        <th> Name </th>
                                        <th> Access URL </th>
                                        <th> Use Dock Checking No </th>
                                        <th> Use Location Sequence </th>
                                        <th> Is Replenishment For Movement </th>
                                        <th> Enable Auto Group Pick Stragety </th>
                                        <th> Pick To Order Weight</th>
                                        <th> Date Created </th>
                                        <th> Date Updated </th>
                                        <th permission-check="{{'facility::management_write'}}"> Actions </th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <tr ng-repeat="facility in facilitiesView track by $index">
                                        <td>{{facility.basic.name}}&nbsp;({{addressMap[facility.id].city}}, {{addressMap[facility.id].state}})</td>
                                        <td>{{facility.accessUrl}}</td>
                                        <td>{{facility.useDockCheckingNo}}</td>
                                        <td>{{facility.useLocationSequence}}</td>
                                        <td>{{facility.isReplenishmentForMovement}}</td>
                                        <td>{{facility.enableAutoGroupPickStragety}}</td>
                                        <td>{{facility.pickToOrderWeight}}</td>
                                        <td>{{facility.createdWhen | amDateFormat:'YYYY-MM-DD HH:mm:ss'}}</td>
                                        <td>{{facility.updatedWhen | amDateFormat:'YYYY-MM-DD HH:mm:ss'}}</td>
                                        <td  permission-check="{{'facility::management_write'}}">
                                            <a ui-sref="cf.facility.facility-management.edit({facilityId: facility.id})"
                                              >Edit</a>&nbsp;&nbsp;
                                        </td>
                                    </tr>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                        <pager total-count="facilities.length"
                               page-size="pageSize" load-content="loadContent(currentPage)"></pager>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
